/* eslint-disable max-len */
/**
 * 应聘登记表
 */
import React from 'react';
import { withRouter } from 'umi';
import moment from 'moment';
import { get as getPath } from 'object-path';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Form, Anchor, Row, Col, message, InputNumber, Radio, Spin, Input, Result } from 'antd';
import { useRequest, defaultFormatResult } from '@/hooks';
import { dictionaryList } from '@/services/dictionary';

import { SalaryYearInput, SalaryMonthInput } from '@/pages/Recruitment/components/SalaryInput';
// import FileUpload from '@/components/Custom/FileUpload';
import {
    InterviewPersonalData,
    // InterviewWorkExperience,
    InterviewEducation,
    // InterviewProject,
    // InterviewTrain,
    // InterviewCertificate,
    // InterviewSkill,
    // InterviewLanguageSkill,
    InterviewResult,
    DeclareInfo,
    InterviewBoxPc,
    FormHeader,
    ButtonPc as Button
} from '@/pages/RecruitEmail/pc/components';
// import { useCompanyName } from '@/pages/Recruitment/RecruitEmail/hooks';
import {
    // getResumeDetail,
    updateRegistration,
    // updateResume,
    getDeclare,
    getRegistrationDetail
} from '@/pages/RecruitEmail/service/interview';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { getFields, transformFileList } from '@/pages/Recruitment/utils';
import pic from '@/pages/RecruitEmail/images/interview-bg-register.png';
import picAccept from '@/pages/RecruitEmail/images/interview-bg-accept.png';
// import { useCheckLogin } from '@/pages/RecruitEmail/hooks';
import styles from './index.less';

const { Link } = Anchor;

const InterviewRegistration = ({ form, location }) => {
    const { query } = location;
    const { nid } = query;
    const { getFieldDecorator } = form;
    const [submitLoading, setSubmitLoading] = React.useState(false);
    const [detailKeysIsReady, setDetailKeysIsReady] = React.useState(false);
    const [done, setDone] = React.useState(false);
    const [showAncor, setShowAncor] = React.useState(false);
    // const { data: companyName } = useCompanyName(query?.id);
    React.useEffect(() => {
        setShowAncor(true);
    }, []);
    // const { isLogin, checkLoading } = useCheckLogin(id, '/recruitment');
    // 获取表单字典
    const { data: dictObj, loading: dictObjLoading, run: getDictionaryList } = useRequest(
        () =>
            dictionaryList({
                codes: ['agreeType', 'sexType', 'academicYear', 'industryType', 'recruitTalentLangType']
            }),
        {
            manual: true,
            formatResult: res => {
                if (res) {
                    const { code, data, msg } = res;
                    if (code === 10000) {
                        const obj = {};
                        data.forEach(item => {
                            if (obj[item.code]) {
                                obj[item.code].push(item);
                            } else {
                                obj[item.code] = [item];
                            }
                        });
                        return obj;
                    }
                    message.error(msg);
                }
                return undefined;
            }
        }
    );

    const { data: declareDetail, run: getDeclareDetail } = useRequest(() => getDeclare(query?.nid), {
        manual: true,
        ...defaultFormatResult
    });

    const { loading: detailLoading, data: resumeDetail, run: fetchResumeDetail } = useRequest(getRegistrationDetail, {
        manual: true,
        ...defaultFormatResult
    });
    const goBack = () => {
        fetchResumeDetail(nid);
    };

    React.useEffect(() => {
        if (resumeDetail) {
            console.log('resumeDetail-----', resumeDetail);
            getDictionaryList();
            getDeclareDetail();
            setDone(false);
            setDetailKeysIsReady(false);
        }
    }, [resumeDetail]);

    const handleSubmit = () => {
        form.validateFieldsAndScroll(async (err, values) => {
            if (!err) {
                // console.log(values);
                // eslint-disable-next-line @typescript-eslint/no-unused-vars
                const { remove, talentWorkType } = values;
                if (declareDetail?.settingSwitch === 1 && !remove) {
                    message.error('提交应聘登记表需勾选同意声明');
                    return;
                }
                // if (values?.talentWorkType === 1 && values?.workKeys.length === 0) {
                //     message.error('请填写工作经历');
                //     return;
                // }
                // if (values?.educationKeys.length === 0) {
                //     message.error('请填写教育背景');
                //     return;
                // }
                // console.log(JSON.stringify(params));
                // const work = values?.workKeys?.map(k => ({
                //     startTime: values?.workStartTime?.[k]?.[0]?.format('YYYY-MM-DD'),
                //     endTime: values?.workStartTime?.[k]?.[1]?.format('YYYY-MM-DD'),
                //     industryType: values?.workIndustryType[k],
                //     companyName: values?.workCompanyName[k],
                //     departmentName: values?.workDepartmentName[k],
                //     positionName: values?.workPositionName[k],
                //     leaveReason: values?.workLeaveReason[k],
                //     workDesc: values?.workWorkDesc[k]
                // }));

                // const project = values?.projectKeys.map(k => ({
                //     startTime: values?.projectStartTime?.[k]?.[0]?.format('YYYY-MM-DD'),
                //     endTime: values?.projectStartTime?.[k]?.[1]?.format('YYYY-MM-DD'),
                //     projectName: values?.projectProjectName[k],
                //     projectDesc: values?.projectProjectDesc[k],
                //     projectWorkDesc: values?.projectProjectWorkDesc[k]
                // }));

                const education = values?.educationKeys.map(k => ({
                    startTime: values?.educationStartTime?.[k]?.[0]?.format('YYYY-MM-DD'),
                    endTime: values?.educationStartTime?.[k]?.[1]?.format('YYYY-MM-DD'),
                    degree: values?.educationDegree[k],
                    graduateSchool: values?.educationGraduateSchool[k],
                    major: values?.educationMajor[k],
                    academicYear: values?.educationAcademicYear[k]
                }));

                // const train = values?.trainKeys.map(k => ({
                //     startTime: values?.trainStartTime?.[k]?.[0]?.format('YYYY-MM-DD'),
                //     endTime: values?.trainStartTime?.[k]?.[1]?.format('YYYY-MM-DD'),
                //     trainOrganize: values?.trainTrainOrganize?.[k],
                //     trainContent: values?.trainTrainContent?.[k]
                // }));

                // const certificate = values?.certificateKeys.map(k => ({
                //     certificateName: values?.certificateCertificateName?.[k],
                //     certificateTime: values?.certificateCertificateTime?.[k].format('YYYY-MM-DD')
                // }));

                // const skill = values?.skillKeys.map(k => ({
                //     proficiency: values?.skillProficiency[k],
                //     skillDuration: values?.skillSkillDuration[k],
                //     skillName: values?.skillSkillName[k]
                // }));

                // const languageSkill = values?.languageSkillKeys.map(k => ({
                //     langType: values?.languageSkillLangType?.[k],
                //     listenSpeakAbility: values?.languageSkillListenSpeakAbility?.[k],
                //     readWriteAbility: values?.languageSkillReadWriteAbility?.[k]
                // }));

                const talentStandardSaveDTO = {
                    expectMonthNumber: values?.expectMonthNumber,
                    expectSalary: values?.expectSalary,
                    phoneAreaCode: values?.phoneAreaCode,
                    talentBirth: values?.talentBirth?.format('YYYY-MM-01'),
                    talentEmail: values?.talentEmail,
                    talentPhone: values?.talentPhone,
                    talentStartWorkTime: values?.talentStartWorkTime?.format('YYYY-MM-01'),
                    lastPostStatus: values?.lastPostStatus,
                    talentName: values?.talentName,
                    talentNameEn: values?.talentNameEn,
                    talentSex: values?.talentSex,
                    // address: Array.isArray(values?.address) ? values?.address?.join(',') : values?.address,
                    // avatarRelation: values?.avatarRelation?.uploadResourceFile
                    //     ? [values?.avatarRelation?.uploadResourceFile]
                    //     : [],
                    // talentIdCard: values?.talentIdCard,

                    // talentNativePlace: Array.isArray(values?.talentNativePlace)
                    //     ? values?.talentNativePlace?.join(',')
                    //     : values?.talentNativePlace,
                    // currentMonthSalary:
                    //     values?.expectMonthNumber === 0
                    //         ? 0
                    //         : Math.floor(values?.expectSalary / values?.expectMonthNumber),

                    // salaryProveRelation: values?.salaryProveRelation?.uploadResourceFile
                    //     ? [values?.salaryProveRelation?.uploadResourceFile]
                    //     : [],
                    // talentWorkType: values?.talentWorkType, // 工作经历
                    // talentWorkSaveDTOList: talentWorkType === 1 ? work : [], // 工作经历
                    // talentProjectSaveDTOList: project, // 项目经历
                    talentEduSaveDTOList: education // 教育经历
                    // talentTrainSaveDTOList: train, // 培训经历
                    // talentCertificateSaveDTOList: certificate, // 获得证书
                    // talentSkillSaveDTOList: skill, // 专业能力
                    // talentLangSaveDTOList: languageSkill // 语言能力
                };

                const finalParams = {
                    // resumeId: resumeDetail?.resumeId,
                    interviewNoticeId: nid,
                    // registerStatusFlag: 1,
                    ...talentStandardSaveDTO
                    // talentOriginalSaveDTO: {}
                };
                // console.log(finalParams);
                // console.log(JSON.stringify(finalParams));
                setSubmitLoading(true);
                updateRegistration(finalParams)
                    .then(res => {
                        const { code, msg } = res;
                        if (code === 10000) {
                            // console.log(data);
                            // message.success('提交成功');
                            setDone(true);
                            // fetchResumeDetail(id);
                        } else {
                            message.error(msg);
                        }
                    })
                    .finally(() => {
                        setSubmitLoading(false);
                    });
            } else {
                console.log('校验失败');
                console.log(err);
                if (err?.remove?.errors.length) {
                    const msg = err?.remove?.errors[0].message;
                    message.error(msg);
                }
            }
        });
    };

    React.useEffect(() => {
        if (nid) {
            fetchResumeDetail(nid);
        }
    }, [nid]);

    const salaryChange = () => {
        Promise.resolve().then(() => {
            const values = form.getFieldsValue(['expectMonthNumber', 'expectSalary', 'currentMonthSalary']);
            const expectSalary = values.expectMonthNumber * values.currentMonthSalary;
            if (!Number.isNaN(expectSalary)) {
                form.setFieldsValue({ expectSalary });
            }
        });
    };

    const expectSalaryChange = () => {
        Promise.resolve().then(() => {
            const values = form.getFieldsValue(['expectMonthNumber', 'expectSalary', 'currentMonthSalary']);
            const number = !values.expectMonthNumber ? 12 : values.expectMonthNumber;
            const currentMonthSalary = Math.ceil(values.expectSalary / number);
            if (!Number.isNaN(currentMonthSalary)) {
                form.setFieldsValue({ currentMonthSalary });
            }
        });
    };

    React.useEffect(() => {
        // if (!resumeDetail || isMobile) {
        if (!resumeDetail) {
            return;
        }
        if (done) {
            return;
        }
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        const { talentEduDetailVOList, talentAvatarFile = [] } = resumeDetail;

        // const workKeys = detail?.talentWorkDetailVOList?.map((_, index) => index) || [];
        // const projectKeys = detail?.talentProjectDetailVOList?.map((_, index) => index) || [];
        const educationKeys = talentEduDetailVOList?.map((_, index) => index) || [];
        // const trainKeys = detail?.talentTrainDetailVOList?.map((_, index) => index) || [];
        // const certificateKeys = detail?.talentCertificateDetailVOList?.map((_, index) => index) || [];
        // const skillKeys = detail?.talentSkillDetailVOList?.map((_, index) => index) || [];
        //  const languageSkillKeys = detail?.talentLangDetailVOList?.map((_, index) => index) || [];

        // const work = getFields(detail?.talentWorkDetailVOList, 'work');
        // const project = getFields(detail?.talentProjectDetailVOList, 'project');
        const education = getFields(talentEduDetailVOList, 'education');
        // const train = getFields(detail?.talentTrainDetailVOList, 'train');
        // const certificate = getFields(detail?.talentCertificateDetailVOList, 'certificate');
        // const skill = getFields(detail?.talentSkillDetailVOList, 'skill');
        // const languageSkill = getFields(detail?.talentLangDetailVOList, 'languageSkill');

        const talentBirth = resumeDetail?.talentBirth ? moment(resumeDetail?.talentBirth) : undefined;
        const talentStartWorkTime = resumeDetail?.talentStartWorkTime
            ? moment(resumeDetail?.talentStartWorkTime)
            : undefined;

        const finalFieldsKeys = {
            // avatarRelation: transformFileList([...talentAvatarFile].splice(-1, 1)),

            lastPostStatus: resumeDetail?.lastPostStatus ? `${resumeDetail?.lastPostStatus}` : undefined,
            talentNameEn: resumeDetail?.talentNameEn,
            talentName: resumeDetail?.talentName,
            phoneAreaCode: resumeDetail?.phoneAreaCode,
            talentPhone: resumeDetail?.talentPhone,
            talentEmail: resumeDetail?.talentEmail,
            // talentIdCard: detail?.talentIdCard,
            // currentMonthSalary: !resumeDetail?.expectMonthNumber
            //     ? 0
            //     : Math.floor(resumeDetail?.expectSalary / resumeDetail?.expectMonthNumber),
            expectMonthNumber: resumeDetail?.expectMonthNumber ? resumeDetail?.expectMonthNumber : 12,
            expectSalary: resumeDetail?.expectSalary,
            // currentSalaryDesc: detail?.currentSalaryDesc,
            // salaryProveRelation: transformFileList(detail?.talentSalaryProveFileList),
            talentBirth,
            talentStartWorkTime,
            talentSex: resumeDetail?.talentSex || '1',
            // address: getPath(resumeDetail, 'address', '') ? getPath(resumeDetail, 'address', '').split(',') : undefined,
            // talentNativePlace: getPath(resumeDetail, 'talentNativePlace', '')
            //     ? getPath(resumeDetail, 'talentNativePlace', '').split(',')
            //     : undefined,
            // talentWorkType: resumeDetail?.talentWorkType || 1,
            // workKeys,
            // projectKeys,
            educationKeys
            // trainKeys,
            // certificateKeys,
            // skillKeys,
            // languageSkillKeys
        };

        const finalFieldsValue = {
            // ...work,
            // workIndustryType: work?.workIndustryType?.map(item => item || undefined),
            // ...project,
            ...education,
            educationAcademicYear: education?.educationAcademicYear?.map(item => item || undefined),
            educationDegree: education?.educationDegree?.map(item => item || undefined)
            // ...train,
            // ...certificate,
            // ...skill,
            // ...languageSkill
        };

        if (!detailKeysIsReady) {
            setDetailKeysIsReady(true);
            console.log('finalFieldsKeys', finalFieldsKeys);
            form.setFieldsValue(finalFieldsKeys);
            expectSalaryChange();
        }

        if (detailKeysIsReady) {
            // console.log('finalFieldsValue-----------', finalFieldsValue, form.getFieldsValue());
            console.log('finalFieldsValue', finalFieldsValue);
            form.setFieldsValue(finalFieldsValue);
        }
    }, [resumeDetail, detailKeysIsReady]);

    const anchor = (
        <Anchor getContainer={() => document.getElementById('scrollContainer') || window} offsetTop={36} bounds={64}>
            <Link href="#resume-base" title="个人信息" />

            {/*
            <Link href="#resume-workInfo" title="工作经历" />
            <Link href="#resume-projectInfo" title="项目经历" /> */}
            <Link href="#resume-education" title="教育背景" />
            <Link href="#resume-intention" title="薪资意向" />
            {/* <Link href="#resume-training" title="培训经历" />
            <Link href="#resume-certificate" title="获得证书" />
            <Link href="#resume-skill" title="专业技能" />
            <Link href="#resume-skillLanguage" title="语言能力" /> */}
            {declareDetail?.settingSwitch === 1 && <Link href="#resume-check" title="声明" />}
        </Anchor>
    );

    // if (done) {
    //     return <Result status="success" title="提交成功！" />;
    // }

    return (
        <div className={styles.interviewPc}>
            <InterviewBoxPc
                titleProps={{
                    // titleAfter: companyName,
                    title: done ? '提交成功' : `${''}请确认并完善相关信息`,
                    content: done ? '欢迎加入 微微科技有限公司' : '《应聘登记表》信息为简历自动解析的结果',
                    wrap: true,
                    sort: !!done,
                    src: done ? picAccept : pic,
                    iconType: done ? 'accept' : '',
                    iconStyle: { color: '#44C69D', marginRight: 12 },
                    picStyle: { marginBottom: 19, marginLeft: 111, marginTop: 24 },
                    showStep: false
                }}
                boxProps={{ style: { padding: '40px 58px' } }}
                showTip={false}
            >
                {!done ? (
                    <Spin spinning={detailLoading}>
                        <div style={{ padding: '0 90px' }} className={styles.formWrapNew}>
                            <div style={{ display: 'flex' }}>
                                <div
                                    style={{
                                        fontSize: 20,
                                        color: 'rgba(0,0,0,0.85)',
                                        fontWeight: 500,
                                        marginRight: '32px',
                                        height: '30px',
                                        lineHeight: '30px',
                                        fontFamily: 'PingFangSC-Medium, PingFang SC'
                                    }}
                                >
                                    <span>应聘职位：</span>
                                    {getPath(resumeDetail, 'dutyName', '')}
                                </div>
                                <div
                                    style={{
                                        fontSize: 14,
                                        color: 'rgba(0,0,0,0.85)',
                                        fontWeight: 400,
                                        height: '30px',
                                        lineHeight: '30px',
                                        fontFamily: 'PingFangSC-Regular'
                                    }}
                                >
                                    <span>应聘日期：</span>
                                    {resumeDetail?.acceptDate}
                                </div>
                            </div>

                            <div
                                style={{
                                    display: 'flex',
                                    flexDirection: 'row'
                                }}
                            >
                                <div style={{ flex: 1 }}>
                                    <FormHeader title="个人信息" id="resume-base" />
                                    <div style={{ paddingLeft: 12 }}>
                                        <InterviewPersonalData
                                            form={form}
                                            dictObj={dictObj}
                                            dictObjLoading={dictObjLoading}
                                        />
                                    </div>

                                    {/* <FormHeader title="工作经历（必填）" id="resume-workInfo" />
                                <Row className={styles.formWrap} style={{ paddingLeft: 12, marginBottom: 0 }}>
                                    <Col span={24}>
                                        <Form.Item label="工作经历">
                                            {getFieldDecorator('talentWorkType', { initialValue: 1 })(
                                                <Radio.Group>
                                                    <Radio value={1}>有工作经历</Radio>
                                                    <Radio value={2}>应届生</Radio>
                                                    <Radio value={3}>在校生</Radio>
                                                </Radio.Group>
                                            )}
                                        </Form.Item>
                                    </Col>
                                </Row>
                                <div
                                    style={{
                                        paddingLeft: 12,
                                        display: form.getFieldValue('talentWorkType') === 1 ? 'block' : 'none'
                                    }}
                                >
                                    <InterviewWorkExperience
                                        form={form}
                                        required={form.getFieldValue('talentWorkType') === 1}
                                        dictObj={dictObj}
                                        dictObjLoading={dictObjLoading}
                                    />
                                </div>
                                <FormHeader title="项目经历" id="resume-projectInfo" />
                                <div style={{ paddingLeft: 12 }}>
                                    <InterviewProject form={form} />
                                </div> */}
                                    <FormHeader title="教育背景（必填）" id="resume-education" />
                                    <div style={{ paddingLeft: 12 }}>
                                        <InterviewEducation
                                            form={form}
                                            dictObj={dictObj}
                                            dictObjLoading={dictObjLoading}
                                        />
                                    </div>
                                    <FormHeader title="薪资意向" id="resume-intention" />
                                    <div style={{ paddingLeft: 12 }} className={styles.formWrapNew}>
                                        <Row gutter={120}>
                                            <Col span={12}>
                                                <Form.Item label="期望年薪" style={{ marginBottom: 0 }}>
                                                    <div style={{ display: 'flex' }}>
                                                        {getFieldDecorator('expectSalary', {
                                                            initialValue: '',
                                                            rules: [
                                                                {
                                                                    required: true,
                                                                    message: '请输入期望年薪'
                                                                }
                                                            ]
                                                        })(
                                                            <InputNumber
                                                                onChange={() => {
                                                                    expectSalaryChange();
                                                                }}
                                                                // min={0}
                                                                // maxLength={8}
                                                                // precision={0}
                                                                step={500}
                                                                placeholder="请输入"
                                                                style={{ width: '100%', maxWidth: 391 }}
                                                                formatter={val => SalaryYearInput(val, true)}
                                                                parser={val => SalaryYearInput(val)}
                                                            />
                                                        )}
                                                        <span
                                                            style={{
                                                                padding: '0 8px',
                                                                fontFamily: 'PingFangSC-Regular',
                                                                fontSize: '16px',
                                                                color: 'rgba(0,0,0,0.85)',
                                                                fontWeight: '500'
                                                            }}
                                                        >
                                                            {resumeDetail?.expectSalaryCurrencyCode ||
                                                                resumeDetail?.companyCurrencyCode ||
                                                                '元'}
                                                        </span>
                                                    </div>
                                                </Form.Item>
                                            </Col>
                                            <Col span={12}>
                                                <Form.Item label="期望月薪" required style={{ marginBottom: 0 }}>
                                                    <Row>
                                                        <Col span={24} style={{ display: 'flex', lineHeight: '40px' }}>
                                                            <Form.Item
                                                                label=""
                                                                colon={false}
                                                                style={{ marginBottom: 0 }}
                                                            >
                                                                {getFieldDecorator('currentMonthSalary', {
                                                                    initialValue: '',
                                                                    rules: [
                                                                        {
                                                                            required: true,
                                                                            message: '请输入月薪'
                                                                        }
                                                                    ]
                                                                })(
                                                                    <InputNumber
                                                                        onChange={() => {
                                                                            salaryChange();
                                                                        }}
                                                                        min={0}
                                                                        // maxLength={8}
                                                                        // precision={0}
                                                                        step={500}
                                                                        placeholder="请输入"
                                                                        style={{ width: '100%' }}
                                                                        formatter={val => SalaryMonthInput(val, true)}
                                                                        parser={val => SalaryMonthInput(val)}
                                                                    />
                                                                )}
                                                            </Form.Item>
                                                            <span
                                                                style={{
                                                                    padding: '0 8px',
                                                                    fontFamily: 'PingFangSC-Regular',
                                                                    fontSize: '16px',
                                                                    color: 'rgba(0,0,0,0.85)',
                                                                    fontWeight: '500'
                                                                }}
                                                            >
                                                                ×
                                                            </span>
                                                            <Form.Item
                                                                label=""
                                                                colon={false}
                                                                style={{ marginBottom: 0 }}
                                                            >
                                                                {getFieldDecorator('expectMonthNumber', {
                                                                    initialValue: 12,
                                                                    rules: [
                                                                        {
                                                                            required: true,
                                                                            message: '请输入发薪月份'
                                                                        }
                                                                    ]
                                                                })(
                                                                    <InputNumber
                                                                        onChange={() => {
                                                                            salaryChange();
                                                                        }}
                                                                        min={1}
                                                                        maxLength={3}
                                                                        precision={0}
                                                                        placeholder="请输入"
                                                                        style={{ width: '100%' }}
                                                                    />
                                                                )}
                                                            </Form.Item>
                                                            <span
                                                                style={{
                                                                    padding: '0 8px',
                                                                    fontFamily: 'PingFangSC-Regular',
                                                                    fontSize: '16px',
                                                                    color: 'rgba(0,0,0,0.85)',
                                                                    fontWeight: '500'
                                                                }}
                                                            >
                                                                {resumeDetail?.expectSalaryCurrencyCode ||
                                                                    resumeDetail?.companyCurrencyCode ||
                                                                    '元'}
                                                            </span>
                                                        </Col>
                                                    </Row>
                                                </Form.Item>
                                            </Col>

                                            {/* <Col span={14}>
                                            <Form.Item label="薪资说明">
                                                {getFieldDecorator('currentSalaryDesc', {
                                                    initialValue: ''
                                                })(
                                                    <Input.TextArea
                                                        placeholder="请输入薪资构成、福利待遇等信息"
                                                        autoSize={{ minRows: 3, maxRows: 6 }}
                                                        maxLength={800}
                                                        style={{ maxWidth: 391, marginTop: 4 }}
                                                    />
                                                )}
                                            </Form.Item>
                                        </Col> */}
                                            {/* <Col span={14}>
                                            <Form.Item label="薪资证明">
                                                {getFieldDecorator('salaryProveRelation')(
                                                    <FileUpload
                                                        categoryCode="talentSalaryProveFile"
                                                        checkFileSize={10}
                                                        checkFileSizeMsg="文件大小不能超过10MB！"
                                                        checkFileType="JPG,JPEG,PNG,MP3"
                                                        checkFileTypeMsg="只能上传JPG,JPEG,PNG,MP3格式的文件！"
                                                    >
                                                        <Button
                                                            icon="upload"
                                                            style={{
                                                                marginTop: 4,
                                                                height: 48,
                                                                maxWidth: 391,
                                                                borderRadius: 4,
                                                                width: '100%',
                                                                fontSize: 18,
                                                                color: '#49536C'
                                                            }}
                                                        >
                                                            添加附件
                                                        </Button>
                                                        <div style={{ padding: '4px 0' }}>
                                                            支持jpg、jpeg、png、mp3等格式的附件，单个文件大小为10MB以内
                                                        </div>
                                                    </FileUpload>
                                                )}
                                            </Form.Item>
                                        </Col> */}
                                        </Row>
                                    </div>
                                    {/* <FormHeader title="培训经历" id="resume-training" />
                                <div style={{ paddingLeft: 12 }}>
                                    <InterviewTrain form={form} />
                                </div>
                                <FormHeader title="获得证书" id="resume-certificate" />
                                <div style={{ paddingLeft: 12 }}>
                                    <InterviewCertificate form={form} />
                                </div>
                                <FormHeader title="专业技能" id="resume-skill" />
                                <div style={{ paddingLeft: 12 }}>
                                    <InterviewSkill form={form} />
                                </div>
                                <FormHeader title="语言能力" id="resume-skillLanguage" />
                                <div style={{ paddingLeft: 12 }}>
                                    <InterviewLanguageSkill
                                        form={form}
                                        dictObj={dictObj}
                                        dictObjLoading={dictObjLoading}
                                    />
                                </div> */}
                                    {declareDetail?.settingSwitch === 1 && (
                                        <>
                                            <FormHeader title="声明" id="resume-check" />
                                            <div style={{ color: '#2A2F3C', fontSize: 16 }}>
                                                <DeclareInfo
                                                    form={form}
                                                    id={query?.id}
                                                    title={declareDetail?.statementContent}
                                                    file={declareDetail?.clause}
                                                />
                                            </div>
                                        </>
                                    )}
                                    {/* <Row style={{ marginTop: 16, fontSize: 16, color: '#BCC1CD' }}>
                                    应聘日期：{moment().format('YYYY年MM月DD日')}
                                </Row> */}
                                </div>
                                <div style={{ marginLeft: 120, marginRight: 20 }} className={styles.anchorWrap}>
                                    {showAncor && anchor}
                                </div>
                            </div>

                            <Button
                                type="primary"
                                style={{ display: 'block', width: 300, margin: '50px auto 30px' }}
                                onClick={handleSubmit}
                                loading={submitLoading}
                            >
                                提交
                            </Button>
                        </div>
                    </Spin>
                ) : (
                    <div style={{ padding: '0 90px', width: '100%' }} className={styles.formWrapNew}>
                        <div
                            style={{
                                maxWidth: 504,
                                margin: '0 auto',
                                boxSizing: 'border-box',
                                height: '100%',
                                display: 'flex',
                                flexDirection: 'column',
                                justifyContent: 'center'
                            }}
                        >
                            <InterviewResult type={99} onClick={goBack} />
                        </div>
                    </div>
                )}
            </InterviewBoxPc>
        </div>
    );
};

export default withRouter(Form.create({})(InterviewRegistration));
